﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Imaginecup.gameState.scroll;
using Microsoft.Xna.Framework;

namespace Imaginecup.scroll
{
    public class HeightDownScroll : IScrollProcess
    {
        private double m_CurrentYPos;
        private int m_MaxY ;
        private double m_ScrollSpeed;
        private bool m_bEnd;

        public HeightDownScroll(double initYPos, double scrollSpeed , int maxY)
        {
            m_CurrentYPos = initYPos;
            m_ScrollSpeed = scrollSpeed;
            m_bEnd = false;
            m_MaxY = maxY;
        }
        public void Scroll(Microsoft.Xna.Framework.GameTime gameTime)
        {
            m_CurrentYPos += (gameTime.ElapsedGameTime.TotalSeconds * m_ScrollSpeed);

            if (m_CurrentYPos > m_MaxY)
            {
                m_CurrentYPos = m_MaxY;
                m_bEnd = true;
            }
        }

        public Vector2 GetCurrentStartPos()
        {
            return new Vector2(0, (float)m_CurrentYPos);
        }

        public bool IsScrollEnd()
        {
            return m_bEnd;
        }
    }
}
